//Source file: C:\\javier\\mario\\Java\\taladro\\control\\Movimiento.java

package taladro.control;


import java.util.TimerTask;
import taladro.maquina.Motor;
import taladro.puerto.PuertoParalelo;
import java.util.Properties;
import java.io.*;

import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;

import controles.interfaz.Consola;

public abstract class Movimiento extends Thread
{
   protected int retardo;
   protected Motor motor;
   protected int numMovs = 0;
   protected PuertoParalelo puerto;
   protected Thread proc;
   protected boolean bDetener = false;
   
   protected double retardoIni = 12.0;
   protected double retardoCont = 9.0;
   
   /**
    * @roseuid 3F35352E0086
    */
   public Movimiento() 
   {
    
   }
   
   /**
    * @param retardo
    * @param motor
    * @roseuid 3F3440380180
    */
   public Movimiento(int retardo,  int numMovs, Motor motor) 
   {
        this.motor = motor;
        this.retardo = retardo;
        this.numMovs = numMovs;
        puerto = motor.getPuerto();
        Properties prop = new Properties();
        
        
        try{
            File file = new File ( "maquina.properties" );
            FileInputStream  fileStream = new FileInputStream ( file  );
            prop.load( fileStream );
            retardoIni = Double.parseDouble( prop.getProperty( "retardo.vel_inicial" ) );
            retardoCont = Double.parseDouble( prop.getProperty( "retardo.vel.continua" ) );
            fileStream.close();
        }catch(Exception e )
        {
        	IConsole consolas[]=ConsolePlugin.getDefault().getConsoleManager().getConsoles();
        	((Consola)consolas[0]).imprime(e.getMessage());
            System.out.println(e.getMessage());
            e.printStackTrace();
        }
   }
   
   /**
    * @roseuid 3F355BB002EE
    */
   public abstract void run();
   
   public void setThread(Thread proc){
       this.proc = proc;
   }
   
   public void detener(){
       bDetener = true;
   }
}
/**
 *  
 * Movimiento.run(){
 *     
 *    }
 *  
 */
